<style>
    table {
        width: 80%;
        margin: 20px auto;
        border-collapse: collapse;
    }

    th,
    td {
        border: 1px solid #ddd;
        padding: 10px;
        text-align: center;
    }

    th {
        background-color: #b8b8b8;
    }

    tr:hover {
        background-color: #f1f1f1;
    }

    .title {
        font-weight: bold;
    }

    .photo-cell {
        height: 90px;

        width: 80px;
        /* 照片单元格占三行的高度 */
    }

    .red {
        color: #cd0000ce;
    }

    .wu {
        color: #6c6c6cce;
    }
</style>
<h2 style="text-align: center;">党员信息</h2>

<table>
    <thead>
        <tr>
            <th colspan="5" class="title" style="background-color: #00b6fee4; color: #ffffff;">基本信息</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>姓名</td>
            {if $data.userinfo.name}
            <td class="red">{$data.userinfo.name}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>性别</td>
            {if $data.user.gender_text}
            <td class="red">{$data.user.gender_text}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td rowspan="3" class="photo-cell" style=" padding:0px;">
                {if $data.image}
                <!-- 如果图片存在，显示图片 -->
                <!-- <image src="http://localhost{$data.image}" mode="scaleToFill"
                    style="width: 100%; height: 100%; object-fit: contain;" /> -->
                <div
                    style="width: 100px; height: 133px; display: flex; justify-content: center; align-items: center; background-color: #f0f0f0;">
                    <img src="{$url}{$data.image}" style="width: 100%; height: 100%; object-fit: contain;" />
                </div>
                {else}
                <!-- 如果图片为空，显示默认的占位图片和文字 -->
                <div
                    style="width: 100px; height: 133px; display: flex; justify-content: center; align-items: center; background-color: #f0f0f0;">
                    <img src="{$url}{$party_member}" alt="默认照片"
                        style="width: 100%; height: 100%; object-fit: contain;" />
                    <div
                        style="position: absolute; color: #ffffff; font-size: 16px;background-color: #6c6c6c82; padding: 10px;border-radius: 5px;">
                        照片</div>
                </div>
                {/if}
            </td>
        </tr>
        <tr>
            <td>民族</td>
            {if $data.userinfo.nationality}
            <td class="red">{$data.userinfo.nationality}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>出生年月</td>
            {if $data.user.birthday}
            <td class="red">{$data.user.birthday}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>手机号码</td>
            {if $data.user.mobile}
            <td class="red">{$data.user.mobile}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>电子邮箱</td>
            {if $data.user.email}
            <td class="red">{$data.user.email}</td>
            {else}
            <td class="wu">无</td>
            {/if}

        </tr>
        <tr>
            <td>学历水平</td>
            {if $data.educational_level}
            <td class="red">{$data.educational_level}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td style="width: 100px; ">政治面貌</td>
            {if $data.actions}
            <td colspan=" 2" class="red">{$data.actions}</td>
            {else}
            <td colspan="2" class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>身份证号码</td>
            {if $data.user.id_no}
            <td colspan="4" class="red" id="idNo">{$data.user.id_no}</td>
            {else}
            <td colspan="4" class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td style="width: 100px; min-width: 100px; max-width: 100px; white-space: nowrap;">现所居住地</td>
            {if $data.user.address}
            <td colspan="4" class="red">{$data.user.address}</td>
            {else}
            <td colspan="4" class="wu">无</td>
            {/if}
        </tr>
    </tbody>
</table>


<table>
    <thead>
        <tr>
            <th colspan="4" class="title" style="background-color: #fe0000e4; color: #ffffff;">党部</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="1">角色</td>
            {if $data.type_text}
            <td colspan="1" class="red">{$data.type_text}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td colspan="1">党员编号</td>
            {if $data.number}
            <td colspan="1" class="red">{$data.number}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>所属支部</td>
            {if $data.department.name}
            <td class="red">{$data.department.name}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>所属党小组</td>
            {if $data.four_department_id}
            <td class="red">{$data.four_department_id}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>党内职务</td>
            {if $data.position_id}
            <td class="red">{$data.position_id}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>党龄</td>
            {if $data.party_standing}
            <td class="red">{$data.party_standing}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>入党转正时间</td>
            {if $data.zjoining_time_text}
            <td colspan="3" class="red">{$data.zjoining_time_text}</td>
            {else}
            <td colspan="3" class="wu">无</td>
            {/if}
        </tr>
    </tbody>
    <thead>
        <tr>
            <th colspan="4" class="title" style="background-color: #fe0000e4; color: #ffffff;">入党积极分子</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td rowspan="3">入党申请书</td>
            {if $data.party_application_book}
            <td rowspan="3" class="red">
                <a style="width: 150px; height: 100px; display: flex; justify-content: center; align-items: center;"
                    href="{$url}{$data.party_application_book}" target="_blank">
                    <img src="{$url}/uploads/Pdf.png" alt="入党申请书" mode="scaleToFill"
                        style="width: 80%; height: 80%; object-fit: contain;" /></a>


            </td>
            {else}
            <td rowspan="3" class="wu">无</td>
            {/if}
            <td>入党申请书提交时间</td>
            {if $data.party_application_time_text}
            <td class="red">{$data.party_application_time_text}</td>
            {else}
            <td class="wu">无</td>
            {/if}

        </tr>
        <tr>
            <td>确定为入党积极分子的日期</td>
            {if $data.party_active_time_text}
            <td class="red">{$data.party_active_time_text}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>政治理论学习情况</td>
            {if $data.study_political_theory}
            <td class="red">{$data.study_political_theory}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
    </tbody>
    <thead>
        <tr>
            <th colspan="4" class="title" style="background-color: #fe0000e4; color: #ffffff;">预备党员</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td rowspan="3">入党志愿书</td>
            {if $data.party_volunteer_book}
            <td style="width: 150px;" rowspan="3" class="red">
                <a style="width: 150px; height: 100px; display: flex; justify-content: center; align-items: center;"
                    href="{$url}{$data.party_volunteer_book}" target="_blank">
                    <img src="{$url}/uploads/Pdf.png" alt="入党申请书" mode="scaleToFill"
                        style="width: 80%; height: 80%; object-fit: contain;" /></a>
            </td>
            {else}
            <td rowspan="3" class="wu">无</td>
            {/if}
            <td>入党志愿书提交时间</td>
            {if $data.party_develop_time_text}
            <td class="red">{$data.party_develop_time_text}</td>
            {else}
            <td class="wu">无</td>
            {/if}

        </tr>
        <tr>
            <td>被接收为预备党员的日期</td>
            {if $data.party_active_time_text}
            <td class="red">{$data.party_active_time_text}</td>
            {else}
            <td class="wu">无</td>
            {/if}

        </tr>
        <tr>
            <td style="width: 150px;">党课培训情况</td>
            {if $data.preparatory_class_training}
            <td class="red">{$data.preparatory_class_training}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>

            <td style="width: 150px;">预备期满日期</td>
            {if $data.preparatory_expiration_time_text}
            <td colspan="3" class="red">{$data.preparatory_expiration_time_text}</td>
            {else}
            <td colspan="3" class="wu">无</td>
            {/if}
        </tr>
    </tbody>
</table>

<table>
    <thead>
        <tr>
            <th colspan="4" class="title" style="background-color: #00fe08e4; color: #ffffff;">学校</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td style="width: 150px;">学校</td>
            {if $data.userinfo.school}
            <td class="red">{$data.userinfo.school}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td style="width: 150px;">学院</td>
            {if $data.userinfo.college}
            <td class="red">{$data.userinfo.college}</td>
            {else}
            <td class="wu">无</td>
            {/if}

        </tr>
        <tr>
            <td>系院</td>
            {if $data.userinfo.system}
            <td class="red">{$data.userinfo.system}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>班级</td>
            {if $data.userinfo.class}
            <td class="red">{$data.userinfo.class}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>专业</td>
            {if $data.major}
            <td class="red">{$data.major}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>班内职务</td>
            {if $data.job}
            <td class="red">{$data.job}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>是否二级学院党委成员</td>
            {if $data.is_sdy}
            <td class="red">{$data.is_sdy}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>是否二级学院党政联席会成员</td>
            {if $data.is_sdz}
            <td class="red">{$data.is_sdz}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>是否班干、学生会干部</td>
            {if $data.is_officer}
            <td class="red">{$data.is_officer}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td></td>
            <td class="red"></td>
        </tr>
    </tbody>
</table>

<table>
    <thead>
        <tr>
            <th colspan="4" class="title">账户信息</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td style="width: 150px;">用户名</td>
            {if $data.user.username}
            <td class="red">{$data.user.username}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td style="width: 150px;">昵称</td>
            {if $data.user.nickname}
            <td class="red">{$data.user.nickname}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>等级</td>
            {if $data.user.level}
            <td class="red">{$data.user.level}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>积分</td>
            {if $data.user.score}
            <td class="red">{$data.user.score}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>连续登录天数</td>
            {if $data.user.successions}
            <td class="red">{$data.user.successions}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>最大连续登录天数</td>
            {if $data.user.maxsuccessions}
            <td class="red">{$data.user.maxsuccessions}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
        <tr>
            <td>上次登录时间</td>
            {if $data.user.prevtime}
            <td class="red">{$data.user.prevtime_text}</td>
            {else}
            <td class="wu">无</td>
            {/if}
            <td>登录IP</td>
            {if $data.user.loginip}
            <td class="red">{$data.user.loginip}</td>
            {else}
            <td class="wu">无</td>
            {/if}
        </tr>
    </tbody>
</table>


<script>
    var idNo = "{$data.user.id_no}";
    if (idNo != '') {
        // 替换身份证号码的中间部分
        var maskedIdNo = idNo.replace(/(\d{2})\d{14}(\d{2})/, '$1**************$2');

        // 显示处理后的身份证号码
        document.getElementById('idNo').textContent = maskedIdNo;
    }
    // 获取身份证号码



</script>